package com.example.helloworld.adapter;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

/**
 * 最近联系人Fragment的数据适配器类
 */
public class LatestContactsFragmentAdapter extends BaseAdapter {

    private String[] list;

    private Context context;

    public LatestContactsFragmentAdapter(Context context, String[] list) {
        this.context = context;
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.length;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        TextView textView = new TextView(context);
        textView.setTextSize(20);
        textView.setTextColor(Color.BLACK);
        textView.setPadding(10, 10, 0, 10);
        textView.setText(list[position]);
        return textView;
    }
}
